/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package cegg.graph.dependency;

import cegg.graph.vertex.ReasonVertex;
import java.awt.Graphics;

/**
 *
 * @author kumper
 */
public class PositiveDependency extends Dependency {

    public static final String LABEL = "R";

    public PositiveDependency(ReasonVertex from, ReasonVertex to) {
        super(from, to);
    }

    public void paint(Graphics g)
    {
        int x = this.getTo().getPositionX()-30;
        int y = (this.getTo().getPositionY() > this.getFrom().getPositionY()) ?
            this.getFrom().getPositionY() : this.getTo().getPositionY();

        g.drawArc(x, y, 30, Math.abs(this.getTo().getPositionY()-this.getFrom().getPositionY()), 90, 180);

        g.drawString(LABEL, x-15, y+(this.getTo().getPositionY()-this.getFrom().getPositionY())/2);

        g.fillArc(x, y+Math.abs(this.getTo().getPositionY()-this.getFrom().getPositionY())-15, 30, 30, 100, 60);
    }

}